import mysql.connector
from flask import Flask,redirect,url_for,render_template,request
import mysql.connector
from flask import jsonify
app = Flask(__name__)

@app.route('/')
def hello_world():
    return render_template('qwer.html')

@app.route('/ok')
def ok():
  conn = None
  cur = None
  conn = mysql.connector.connect(
              host='localhost',
              user='root',  # 替换为你的MySQL用户名
              password='',  # 替换为你的MySQL密码
              database='thello'
          )
  cur = conn.cursor()
  sql="""SELECT
    place,count
  FROM
    place
  ;
  """
  cur.execute(sql)
  all_data = cur.fetchall()
  
  return all_data

if __name__ == '__main__':
   app.run()